// import type { App } from 'vue';
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

const publicRoutes: Array<RouteRecordRaw> = [
    {
		path: '/',
		name: 'word',
		component: () => import('@/components/HelloWorld.vue'),
		children:[
			{
				path: '/test',
				name: 'testIndex',
				component: () => import('@/views/test/index.vue'),
			}
		]
        // redirect: "/1"
	},
	{
		path:'/home',
		name: 'homeIndex',
		component: () => import('@/views/home/index.vue'),
	},
	{
		path: '/login',
		name: 'loginIndex',
		component: () => import('@/views/login/index.vue'),
	}
	
];

const router = createRouter({
	history: createWebHashHistory(),
	routes: publicRoutes
});
export default router
// export function resetRouter() {
// 	router.getRoutes().forEach((route) => {
// 		const { name } = route;
// 		if (name) {
// 			router.hasRoute(name) && router.removeRoute(name);
// 		}
// 	});
// }

